package com.koron.plan.web.patrollineplan.bean.properties;

import com.koron.common.core.business.configsettings.utils.ConfigInfoTool;
import lombok.Data;

import java.util.Map;

/**
 * @author jzp
 * @since 2022/11/29
 */
@Data
public class LineDeviceProperties {
    // 高压线路根节点
    private String rootId;
    // 根节点层级
    private int rootLevel;
    // 线路层级
    private int lineLevel;
    // 杆塔层级
    private int towerLevel;
    // 部件层级
    private int partsLevel;

    public LineDeviceProperties() {
        Map<String, String> config = ConfigInfoTool.getConfigByCode("equipment", "line_root_device");
        rootId = config.get("id");
        rootLevel = Integer.parseInt(config.get("level"));
        lineLevel = rootLevel + 1;
        towerLevel = rootLevel + 2;
        partsLevel = rootLevel + 3;
    }

}
